import time
def metric(fn):
    def account_metric(*args, **kwargs):
        start_time = time.time()
        fn(*args, **kwargs)
        end_time = time.time()
        print('程序用时：%s秒' % int(end_time - start_time))
    return account_metric


@metric
def test(x):
    sum = 0
    for i in range(x):
        for j in range(x):
            for k in range(x):
                sum +=i+j+k
    print('函数和=',sum)
print('test')


test(300)
